import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';

class LGet {

  static double get startBarHeight => (MediaQueryData.fromWindow(window).padding.top );
  static double get areaHeight => (MediaQueryData.fromWindow(window).padding.top + kToolbarHeight);

  static double get bodyHeight => Get.height - areaHeight;
  static  bottomPadding(context) => MediaQuery.of(context).padding.bottom;

  S get<S>(S Function() builder, {tag}) {
    S? s;
    try {
      s = Get.find<S>(tag: tag);
      return s!;
    } catch (e) {
      return Get.put(builder());
    }
  }
}
